<script language="JavaScript" type="text/javascript">
<!--
var post_submit = false;
function chkFormular() {
	if(document.getElementById('message').value == "") {
		alert("%enter_text%");
		document.getElementById('message').focus();
   		return false;
	}
	if(!validbbcode(document.getElementById('message').value)){
		return false;
	}
	if(post_submit == true){
		return false;
	}
	post_submit = true;
}

function ChangeFormAction() {
	if(document.getElementById('preview').checked == true) {
		document.post.action = "forum_topic";
	}
	else {
		document.post.action = "forum_topic.php";
	}
	
}
-->
</script>

<form action="forum_topic.php" method="post" id="post" name="post" onsubmit="return chkFormular()">
<table width="100%" border="0" cellspacing="0" cellpadding="2" bgcolor="$border">
  <tr>
    <td class="title" align="center" bgcolor="$bghead">%new_reply%</td>
  </tr>
  <tr><td bgcolor="$pagebg"></td></tr>
  <tr>
    <td bgcolor="$bg1"><br />
    <table width="100%" border="0" align="center" cellpadding="2" cellspacing="0">
      <tr>
        <td colspan="2">$addbbcode</td>
      </tr>
      <tr>
        <td colspan="2"><textarea name="message" id="message" rows="10" cols="50" style="width:99%;">$message</textarea></td>
      </tr>
      <tr>
      <td colspan="2"><iframe width="100%" height="110px" frameborder="0" src="http://beta.skyleaguestudio.com/imgup/"></iframe></td>
      </tr>
      <tr>
        <td colspan="2"><small><b>%options%:</b> &#8226; %html_off% &#8226; %bbcode_on% &#8226; %smilies_on%</small></td>
      </tr>
      <tr>
        <td><input class="input" type="checkbox" name="notify" value="1" $notify /> %notify_reply%<br />
        <input class="input" type="checkbox" name="preview" id="preview" value="1" onclick="ChangeFormAction()" /> %preview_post% $chk_sticky</td>
        <td align="right" valign="bottom"><input type="hidden" name="userID" value="$userID" />
        <input type="hidden" name="board" value="$board" />
        <input type="hidden" name="topic" value="$topic" />
        <input type="hidden" name="page" value="$page" />
        <input type="hidden" name="addreply" value="true" />
        <input name="newreply" id="add_post_submit" type="submit" value="%post_new_reply%" /></td>
      </tr>
    </table>
    </td>
  </tr>
</table>
</form>